package Tracker;

//import java.awt.EventQueue;
//import Tracker.view.Frame;

import java.io.IOException;
import java.net.InetSocketAddress;

import Tracker.http.FileStreamer;
import Tracker.http.Handler;
import Tracker.http.Uploader;

import com.sun.net.httpserver.*;

public class RunClient {

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {

		HttpServer server;
		try {
			server = HttpServer.create(new InetSocketAddress(8080), 8080);
			server.createContext("/upload", new Uploader());
			server.createContext("/api", new Handler());
			server.createContext("/", new FileStreamer());
			server.setExecutor(null); // creates a default executor
			server.start();
			System.out.println("Client: HTTP Server listening on port 8080");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
